Module implementing a QFileSystemWatcher replacement based on the 'watchdog' package.
| _GlobalFileSystemWatcher |
| EricFileSystemWatcher | Class implementing a file system monitor based on the 'watchdog' package as a replacement for 'QFileSystemWatcher'. |
| _EricFileSystemEventHandler | Class implementing a QObject based file system event handler for watchdog. |
| instance | Function to get a reference to the global file system monitor object. |
Class implementing a file system monitor based on the 'watchdog' package as a replacement for 'QFileSystemWatcher'.
This class has more fine grained signaling capability compared to QFileSystemWatcher. The 'directoryChanged' and 'fileChanged' signals are emitted to keep the API compatible with QFileSystemWatcher.
Note: On Linux and macOS systems it might be necessary to increase the limit of open file descriptors to at least 1024. This can be done by including the command 'ulimit -n 1024' in the users profile file (~/.profile).
| None |
| None |
| EricFileSystemWatcher | Constructor |
| __del__ | Special method called when an instance object is about to be destroyed. |
| __directoryChanged | Private slot handling any change of a directory at a given path. |
| __fileChanged | Private slot handling any change of a file at a given path. |
| addPath | Public method to add the given path to the list of watched paths. |
| addPaths | Public method to add each path of the given list to the file system watched. |
| directories | Public method to return a list of paths to directories that are being watched. |
| files | Public method to return a list of paths to files that are being watched. |
| paths | Public method to return a list of paths that are being watched. |
| removePath | Public method to remove a given path from the list of monitored paths. |
| removePaths | Public method to remove the specified paths from the list of monitored paths. |
| shutdown | Public method to shut down the file system watcher instance. |
| None |
Constructor
Special method called when an instance object is about to be destroyed.
Private slot handling any change of a directory at a given path.
It emits the signal 'directoryChanged', if the path is in the list of watched paths. This behavior is compatible with the QFileSystemWatcher signal of identical name.
Private slot handling any change of a file at a given path.
It emits the signal 'fileChanged', if the path is in the list of watched paths. This behavior is compatible with the QFileSystemWatcher signal of identical name.
Public method to add the given path to the list of watched paths.
If the given path is a directory, a recursive watch may be requested. Otherwise only the given directory is watched for changes but none of its subdirectories.
The path is not added, if it does not exist or if it is already being monitored by the file system watcher.
Public method to add each path of the given list to the file system watched.
If a path of the given paths list is a directory, a recursive watch may be requested. Otherwise only the given directory is watched for changes but none of its subdirectories. This applies to all directory paths of the given list.
A path of the list is not added, if it does not exist or if it is already being monitored by the file system watcher.
Public method to return a list of paths to directories that are being watched.
Public method to return a list of paths to files that are being watched.
Public method to return a list of paths that are being watched.
Public method to remove a given path from the list of monitored paths.
Public method to remove the specified paths from the list of monitored paths.
Public method to shut down the file system watcher instance.
This needs to be done in order to stop the monitoring threads doing their work in the background. If this method was not called explicitly when the instance is about to be destroyed, the special method '__del__' will do that.
Class implementing a QObject based file system event handler for watchdog.
| None |
| None |
| _EricFileSystemEventHandler | Constructor |
| on_any_event | Private method handling any file system event. |
| on_closed | Private method to handle a closing event for a file that was opened for writing. |
| on_closed_no_write | Private method to handle a closing event for a file that was opened for reading. |
| on_created | Private method to handle a creation event. |
| on_deleted | Private method to handle a deletion event. |
| on_modified | Private method to handle a modification event. |
| on_moved | Private method to handle a move or rename event. |
| None |
Constructor
Private method handling any file system event.
Private method to handle a closing event for a file that was opened for writing.
Private method to handle a closing event for a file that was opened for reading.
Private method to handle a creation event.
Private method to handle a deletion event.
Private method to handle a modification event.
Private method to handle a move or rename event.
Function to get a reference to the global file system monitor object.
If the global file system monitor does not exist yet, it will be created automatically.